package cn.wubo.beetsql.controller;

import cn.wubo.beetsql.entity.Custom;
import cn.wubo.beetsql.service.ICustomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/custom")
public class CustomController {
    @Autowired
    ICustomService customService;

    @RequestMapping(value = "/selectCustom", method = RequestMethod.GET)
    public List<Custom> selectCustom(@RequestParam(value = "name") String name) {
        Custom custom = new Custom();
        custom.setName(name);
        return customService.selectCustom(custom);
    }

    @RequestMapping(value = "/selectCustomOther", method = RequestMethod.GET)
    public List<Custom> selectCustomOther(@RequestParam(value = "name") String name) {
        Custom custom = new Custom();
        custom.setName(name);
        return customService.selectCustomOther(custom);
    }
}
